﻿using LdtJudge.DataEngine.Data;
using LdtJudge.DataEngine.Model;
using LdtJudge.DataEngine.Model.DataModel;
using LdtJudge.DataEngine.Model.DataModel.ElementNode;
using LdtJudge.DataEngine.Model.DataModel.SysCommon;
using LdtJudge.DataEngine.Model.ElmentModel;
using LdtJudge.DataEngine.Model.OptimizationModel;
using LdtJudge.DataEngine.Model.Personnel;
using LdtJudge.DataEngine.Model.UnitModel;
using LdtJudge.DataEngine.Model.XMLConfigModel.CircumsatanModel;
using LdtJudge.DataEngine.Model.XMLConfigModel.DataStores;
using LdtJudge.DataEngine.Model.XMLConfigModel.Dudection;
using LdtJudge.DataEngine.Model.XMLConfigModel.OptimizeConfigModel;
using System.Collections.Generic;
using System.Data;
using System.Xml;

namespace LdtJudge.DataEngine.DataBaseStores.DynamicData
{
    public class DataLayerStores
    {

        public void Start()
        {
            //SqlDALDataBaseStoresSYSTable sqlDALDataBaseStoresSYSTable = new SqlDALDataBaseStoresSYSTable();

            //ConfigEXTTableColumnRule = sqlDALDataBaseStoresSYSTable.GetTable_EXTTableColumnRule(docID);//获取表列提取规则配置

        }
        /// <summary>
        /// 释放资源
        /// </summary>
        public void Dispose()
        {
            AnalysisParameter = null;
        }



        #region 人员对话数据集合-要素提取用到
        /// <summary>
        /// 人员对话数据集合
        /// </summary>
        public DataTable spokePersonJoin { get; set; }

        /// <summary>
        /// 段落配置
        /// </summary>
        private List<ParagraphAnalysisFactListItem> _paragraphAnalysisFactListItemList = new List<ParagraphAnalysisFactListItem>();

        /// <summary>
        /// 段落配置
        /// </summary>
        public List<ParagraphAnalysisFactListItem> paragraphAnalysisFactListItemList
        {
            get { return _paragraphAnalysisFactListItemList; }
            set { _paragraphAnalysisFactListItemList = value; }
        }

        #endregion

        #region 优选配置
        /// <summary>
        /// 要素优选数据配置
        /// </summary>
        public OptimizeFactConfig GetOptimizeFactConfig { get; set; }
        /// <summary>
        /// 情形情节配置
        /// </summary>
        public CircumsatanModel CircumsatanModel
        {
            get { return _CircumsatanModel; }
            set { _CircumsatanModel = value; }
        }

        private CircumsatanModel _CircumsatanModel = new CircumsatanModel();

        public int TextType { get; set; }
        #endregion

        #region 基础信息集合

        /// <summary>
        /// 案件信息
        /// </summary>
        private AnalysisParameterModel _AnalysisParameter = new AnalysisParameterModel();

        private List<Model.Collection.LocationModel> _locationModelList = new List<Model.Collection.LocationModel>();

        /// <summary>
        /// 获取配置的要素定位信息
        /// </summary>
        public List<Model.Collection.LocationModel> locationModelList
        {
            get { return _locationModelList; }
            set { _locationModelList = value; }
        }

        /// <summary>
        /// 案件信息
        /// </summary>
        public AnalysisParameterModel AnalysisParameter
        {
            get { return _AnalysisParameter; }
            set { _AnalysisParameter = value; }
        }
        /// <summary>
        /// 配置信息 配置文件代称+配置实体
        /// </summary>
        private List<ConfigurationFileModel> _ConfigurationFileModelList = new List<ConfigurationFileModel>();

        /// <summary>
        /// 配置文件信息
        /// </summary>
        public List<ConfigurationFileModel> ConfigurationFileModelList
        {
            get { return _ConfigurationFileModelList; }
            set { _ConfigurationFileModelList = value; }
        }

        private List<ElementSpokeName> _elementSpokeList = new List<ElementSpokeName>();

        /// <summary>
        /// 人员信息实体
        /// </summary>
        public List<ElementSpokeName> ElementSpokeList
        {
            get { return _elementSpokeList; }
            set { _elementSpokeList = value; }
        }
        /// <summary>
        /// 解析步骤信息 模块名称+步骤信息
        /// </summary>
        public Dictionary<string, List<ConfigStateModel>> DicConfigState { get; set; }


        private List<CaseCauseModel> _caseCausesList = new List<CaseCauseModel>();

        /// <summary>
        /// 人员对话实体
        /// </summary>
        private List<ElementExtractText> _spokeText = new List<ElementExtractText>();

        /// <summary>
        /// 人员对话实体
        /// </summary>
        public List<ElementExtractText> SpokeTextDialogue
        {
            get { return _spokeText; }
            set { _spokeText = value; }
        }

        /// <summary>
        /// 文书ID
        /// </summary>
        public string SD_id { get; set; }
        /// <summary>
        /// 案由信息表
        /// </summary>
        public List<CaseCauseModel> CaseCausesList
        {
            get { return _caseCausesList; }
            set { _caseCausesList = value; }
        }

        /// <summary>
        /// 案由要素信息表
        /// </summary>
        private Dictionary<string, List<NodeModelList>> caseCauseElementList = new Dictionary<string, List<NodeModelList>>();
        /// <summary>
        /// 案由要素节点信息
        /// </summary>
        public Dictionary<string, List<NodeModelList>> CaseCauseElementList
        {
            get { return caseCauseElementList; }
            set { caseCauseElementList = value; }
        }

        /// <summary>
        /// 案件要素信息列表
        /// </summary>
        private List<ElementNodeModel> _elementNodeModelsList = new List<ElementNodeModel>();

        /// <summary>
        /// 案件要素节点信息
        /// </summary>
        public List<ElementNodeModel> elementNodeModelsList
        {
            get { return _elementNodeModelsList; }
            set { _elementNodeModelsList = value; }
        }


        #endregion

        #region 基础字段集合
        /// <summary>
        /// 根据文书获取到需要分析的文书表列配置集合
        /// The configuration ext table column rule
        /// </summary>
        public DataTable ConfigEXTTableColumnRule;
        /// <summary>
        /// 案件类型
        /// </summary>
        public string caseType { get; set; }
        /// <summary>
        /// 文书类型
        /// </summary>
        public string docID { get; set; }

        /// <summary>
        /// 云柜中的文件ID
        /// </summary>
        public string FL_ID { get; set; }
        /// <summary>
        /// 数据源ID
        /// </summary>
        public string SF_ID { get; set; }
        /// <summary>
        /// 案由
        /// </summary>
        public string caseCause { get; set; }
        /// <summary>
        /// 法院ID
        /// </summary>
        public string courtId { get; set; }
        /// <summary>
        /// 应用id
        /// </summary>
        public string appId { get; set; }

        /// <summary>
        /// 案件唯一ID
        /// </summary>
        public string Caseid { get; set; }

        /// <summary>
        ///文书唯一ID
        /// </summary>
        public string SD_CaseOnlyID { get; set; }

        /// <summary>
        /// 原文信息
        /// </summary>
        public string SourceContent { get; set; }

        /// <summary>
        /// 要素分析结果
        /// </summary>
        public XmlDocument ElementAnalysisResults { get; set; }

        /// <summary>
        /// 要素过程数据
        /// </summary>
        public List<DataModel> ElementAnalsisDataModelResults { get; set; }

        /// <summary>
        /// 要素优选结果数据
        /// </summary>
        public List<DataModel> ElementOptimizationResults { get; set; }

        /// <summary>
        /// 是否对数据进行保存true保存false不保存
        /// </summary>
        public bool IsSave = true;

        /// <summary>
        /// 消息ID
        /// </summary>
        public string msgID { get; set; }
        #endregion

        #region 优选数据

        /// <summary>
        /// 人员转换配置
        /// </summary>
        public PersonnelConversionModel personnelConversionModel { get; set; }
        /// <summary>
        /// 优选文件数据
        /// </summary>
        public string XmlConfigStr { get; set; }

        /// <summary>
        /// 合并后要素数据
        /// </summary>
        public XmlDocument MergeElementXml { get; set; }
        /// <summary>
        /// 优选数据结果
        /// </summary>
        public XmlDocument OptimizationXml { get; set; }
        /// <summary>
        /// 优选后案由要素实体结果
        /// </summary>
        public string OptimizeCauseEntityXml { get; set; }

        /// <summary>
        /// 要素优选结果
        /// </summary>
        public XmlDocument OptimizationElementXml { get; set; }
        /// <summary>
        /// 数据分析结果
        /// </summary>
        public XmlDocument AnalysisResultsXml { get; set; }

        /// <summary>
        /// 分析实体对象
        /// </summary>
        public DataSoursModel AnalysisResultsDataModel { get; set; }
        /// <summary>
        /// 数据源XML
        /// </summary>
        public XmlDocument SourdataXml { get; set; }

        /// <summary>
        /// 优选结果
        /// </summary>
        public List<DataModel> SourdatModleList { get; set; }
        /// <summary>
        /// 优选结果
        /// </summary>
        public CaseCenterModel caseCenterModel
        {
            get { return _casecenterModel; }
            set { _casecenterModel = value; }
        }
        /// <summary>
        /// 理由要素
        /// </summary>
        public List<DataModel> ReasonDataModel = new List<DataModel>();

        /// <summary>
        ///理由要素内容
        /// </summary>
        public XmlDocument ReasonXML = new XmlDocument();

        private CaseCenterModel _casecenterModel = new CaseCenterModel();

        /// <summary>
        /// 上次分析结果
        /// </summary>
        public List<DataModel> LastResultModelList = new List<DataModel>();



        #endregion
    }
}
